#ifndef _TIMING_H_
#define _TIMING_H_

#include <event.h>

typedef int (* ONTIMING_FUNC)(const void * obj);

typedef struct TIMING {
	struct event_base	*base;
	struct event		event;
	struct timeval		interval;
	const void			*obj;
	ONTIMING_FUNC		ontiming;
} TIMING;


TIMING * timing_new(unsigned int usec, ONTIMING_FUNC ontiming,
					struct event_base * base, const void * obj);
int timing_free(TIMING * t);

#endif
